'use strict'


module.exports = app => {
    const mongoose = app.mongoose
    const Schema = mongoose.Schema
    const ObjectId = Schema.Types.ObjectId
    const DynamicSchema = new Schema({
        user_id:{
            type:ObjectId,
            ref:'User'
        },
        create_time:{
            type:Date,
            default:Date.now
        },
        type:{
            type:String,
            enum:['赞同了回答','关注了问题','关注了用户','回答了问题','提出了问题']
        },
        question_id:{
            type:ObjectId,
            ref:'Question'
        },
        reply_id:{
            type:ObjectId,
            ref:'Reply'
        },
        attention_user_id:{
            type:ObjectId,
            ref:'User'
        }


    },{ versionKey:false })

    return mongoose.model('Dynamic',DynamicSchema,'Dynamic')
}
